<template>
	<div>
		<el-row :gutter="24">
			<el-col :span="1" style="margin-right:10px;">
				<p class="queryLabel">区域:</p>
			</el-col>
			<el-col :span="4">
				<el-select size="small" v-model="queryData.area" style="width: 100%;" placeholder="请选择" clearable @change="getCompanyInfo">
					<el-option v-for="item in areaCombo" :label="item.label" :value="item.code"></el-option>
				</el-select>
			</el-col>
			<el-col :span="1" style="margin-right:10px;">
				<p class="queryLabel">4S店:</p>
			</el-col>
			<el-col :span="4">
				<el-select size="small" v-model="queryData.companyId" style="width: 100%;" placeholder="请选择" clearable>
					<el-option v-for="item in companyCombo" :label="item.oName" :value="item.id"></el-option>
				</el-select>
			</el-col>
			<el-col :span="1" style="margin-right:10px;">
				<p class="queryLabel">求助人 :</p>
			</el-col>
			<el-col :span="4">
				<el-input size="small" :maxlength="200" style="width: 95%;" v-model="queryData.appealName" placeholder="请输入">
				</el-input>
			</el-col>
			<el-col :span="1" style="margin-right:10px;">
				<p class="queryLabel">车牌号 :</p>
			</el-col>
			<el-col :span="4">
				<el-input size="small" :maxlength="200" style="width: 95%;" v-model="queryData.plateNum" placeholder="请输入">
				</el-input>
			</el-col>
		</el-row>
		<el-row :gutter="24">
			<el-col :span="1" style="margin-right:10px;">
				<p class="queryLabel">VIN :</p>
			</el-col>
			<el-col :span="4">
				<el-input size="small" :maxlength="200" style="width: 95%;" v-model="queryData.vin" placeholder="请输入">
				</el-input>
			</el-col>
			<el-col :span="1" style="margin-right:10px;">
				<p class="queryLabel">求助日期 :</p>
			</el-col>
			<el-col :span="4">
				<el-date-picker v-model="queryData.helpDate" size="small" style="width:95%" type="date" clearable placeholder="选择时间">
				</el-date-picker>
			</el-col>
			<el-col :span="1" style="margin-right:10px;">
				<p class="queryLabel">完成日期 :</p>
			</el-col>
			<el-col :span="4">
				<el-date-picker v-model="queryData.doneDate" size="small" style="width:95%" type="date" clearable placeholder="选择时间">
				</el-date-picker>
			</el-col>
			<el-col :span="1" style="margin-right:10px;">
				<p class="queryLabel">状态:</p>
			</el-col>
			<el-col :span="4">
				<el-select size="small" v-model="queryData.status" style="width: 100%;" placeholder="请选择" clearable>
					<el-option label="未处理" value="0"></el-option>
					<el-option label="已处理" value="1"></el-option>
				</el-select>
			</el-col>
			<el-col :span="4" style="margin-left: -40px;text-align: right;">
				<el-button size="small" type="primary" @click="queryAppeal">查 询</el-button>
				<el-button size="small" type="primary" @click="handleAppeal" v-if="btnGroup.handle">处 理</el-button>
			</el-col>
		</el-row>
		<el-row>
			<el-table :data="tableData.dataList" border style="width: 100%;align-content: center;" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName">
				<el-table-column type="selection" width="60">
				</el-table-column>
				<el-table-column label="4S店" prop="oName">
				</el-table-column>
				<el-table-column label="求助人" prop="seekHelpUserName">
				</el-table-column>
				<el-table-column label="VIN" prop="vin">
				</el-table-column>
				<el-table-column label="车牌号" prop="plateNum">
				</el-table-column>
				<el-table-column label="求助时间" prop="seekHelpTime">
				</el-table-column>
				<el-table-column label="求助原因" prop="seekHelpRemark">
				</el-table-column>
				<el-table-column label="状态" prop="status" :formatter="statusCov">
				</el-table-column>
				<el-table-column label="完成人" prop="completionUserName">
				</el-table-column>
				<el-table-column label="完成时间" prop="completionTime">
				</el-table-column>
			</el-table>
			<el-pagination small @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="CurentPage" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout=" total,prev, pager, next" :total="tableData.total">
			</el-pagination>
		</el-row>
		<el-dialog title="求助处理" v-model="handleAppealShow" size="large">
			<el-row :gutter="24">
				<el-col :span="15">
					<el-card class="fit" style="width: 100%;">
						<el-form :model="comFormData" ref="comForm" label-width="100px">
							<el-col :span="12">
								<el-form-item label="车牌号：">
									<el-input size="small" :maxlength="200" v-model="comFormData.plateNum" readonly></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="车型：">
									<el-input size="small" :maxlength="200" v-model="comFormData.carModel" readonly></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="VIN：">
									<el-input size="small" :maxlength="200" v-model="comFormData.vin" readonly></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="车龄：">
									<el-input size="small" :maxlength="200" v-model="comFormData.carAge" readonly></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="被保险人：">
									<el-input size="small" :maxlength="200" v-model="comFormData.insured" readonly placeholder=""></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="联系电话：">
									<el-input size="small" :maxlength="200" v-model="comFormData.contactPhone" readonly placeholder=""></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="投保公司：">
									<el-input size="small" :maxlength="200" v-model="comFormData.insuranceCompany" readonly placeholder=""></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="保险到期日：">
									<el-input size="small" :maxlength="200" v-model="comFormData.insuranceEndDate" readonly placeholder=""></el-input>
								</el-form-item>
							</el-col>
						</el-form>
					</el-card>
					<br>
					<el-card class="fit" style="width:100%;height: 300px">
						<el-table :data="insPriceData" border style="align-content: center;">
							<el-table-column label="保险公司" prop="insuranceCompanyName">
							</el-table-column>
							<el-table-column label="保险类型" prop="insureType" :formatter="insureTypeCov">
							</el-table-column>
							<el-table-column label="被保险人" prop="insured">
							</el-table-column>
							<el-table-column label="保险起始日期" prop="insuranceStartDate">
							</el-table-column>
							<el-table-column label="单据创建日期" prop="createTime">
							</el-table-column>
							<el-table-column label="交强险金额" prop="compulsoryTotal">
							</el-table-column>
							<el-table-column label="商业险金额" prop="commercialinsuranceTotal">
							</el-table-column>
							<el-table-column label="操作" align="right" width="70px" fixed="right">
								<template scope="scope">
									<el-button type="primary" size="mini" @click.native.prevent="changePrice(scope.$index)">修改</el-button>
								</template>
							</el-table-column>
						</el-table>
					</el-card>
				</el-col>
				<el-col :span="9">
					<el-card class="fit" style="height: 250px;overflow-y: scroll;">
						<div slot="header" v-for="item in work.workOrder">
							<el-tag type="primary">
								{{item.type}}
							</el-tag>
							<el-tag type="primary">
								{{item.maintain_type}}
							</el-tag>
							<el-tag type="primary">
								{{item.run_mile}}&nbsp;km
							</el-tag>
							<el-tag type="primary">
								￥{{item.real_amount}}
							</el-tag>
							<br />
							<el-tag type="primary">
								{{countTime(item.balance_date)}}
							</el-tag>
							<el-tag type="primary">
								{{item.order_num}}
							</el-tag>
							<el-tag type="primary">
								{{item.receptor}}
							</el-tag>
							<!--延保、续保标签 // 后台传值则标签显示，后台不传值则标签不显示-->
							<el-tag type="primary" v-if="item.xb">
								续保
							</el-tag>
							<el-tag type="primary" v-if="item.yb">
								延保
							</el-tag>
							<el-tag type="primary" v-if="item.continuation == '2'||item.continuation == 2">
								二连保
							</el-tag>
							<el-tag type="primary" v-if="item.continuation == '3'||item.continuation == 3">
								三连保
							</el-tag>
							<el-button type="primary" size="small" @click="butClick">详情</el-button>
						</div>
						<el-row style='margin-top: 5px;'>
							<el-col :span="6" class="pag">
							</el-col>
							<el-col :span="18" class="pag">
								<strong>维修项目</strong>
							</el-col>
						</el-row>
						<el-row v-for="item in work.workItem">
							<el-col :span="6" class="pag">
							</el-col>
							<el-col :span="18" class="pag">
								{{item.item_name}}
							</el-col>
						</el-row>
					</el-card>
					<hisConcat :vin="comFormData.vin" :companyId="companyId" :change="changeHis" v-if="handleAppealShow">
					</hisConcat>
				</el-col>
			</el-row>
		</el-dialog>
		<!--
        	作者：1040117458@qq.com
        	时间：2017-10-27
        	描述：修改报价单
        -->
		<el-dialog title="报价单维护" v-model="comFormShows" size="large" :before-close="comFormShowsClose">
			<el-row :gutter="24">
				<el-col :span="2" style="margin-right:10px;">
					<p class="queryLabel">投保起始日:</p>
				</el-col>
				<el-col :span="9">
					<el-date-picker size="small" style="width: 100%; margin-left: 4px;" disabled v-model="infoData.insuranceStartDate" format="yyyy-MM-dd" type="date" placeholder="开始时间">
					</el-date-picker>
				</el-col>
				<el-col :span="2" style="margin-right:10px;">
					<p class="queryLabel">投保结束日:</p>
				</el-col>
				<el-col :span="9">
					<el-date-picker size="small" style="width: 100%; margin-left: 4px;" disabled v-model="infoData.insuranceStopDate" format="yyyy-MM-dd" type="date" placeholder="结束时间">
					</el-date-picker>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-card class="box-carda">
						<el-form :model="infoData" ref="comForm" :rules="Rule" label-width="150px">
							<el-col :span="6">
								<!--TODO-->
								<el-form-item label="被保险人：" prop="insured">
									<el-input size="small" :maxlength="200" v-model="infoData.insured">
										<el-select v-model="infoData.source" style="width: 80px;" slot="prepend">
											<el-option label="个人" value="0"></el-option>
											<el-option label="单位" value="1"></el-option>
										</el-select>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="被保险人证件号：" prop="insuredIdNumber">
									<el-input size="small" :maxlength="200" v-model="infoData.insuredIdNumber"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="被保险人地址：">
									<el-input size="small" :maxlength="200" v-model="infoData.insuredAddress"></el-input>
								</el-form-item>
							</el-col>
							<!--<el-col :span="6">
								<el-form-item label="邮编：" prop="postCode">
									<el-input size="small" :maxlength="200" v-model="infoData.postCode"></el-input>
								</el-form-item>
							</el-col>-->
							<el-col :span="6">
								<el-form-item label="联系人：" prop="contactName">
									<el-input size="small" :maxlength="200" v-model="infoData.contactName"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="联系电话：" prop="contactPhone">
									<el-input size="small" :maxlength="200" v-model="infoData.contactPhone"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="E_mail：" prop="email">
									<el-input size="small" :maxlength="200" v-model="infoData.email"></el-input>
								</el-form-item>
							</el-col>

							<el-col :span="6">
								<el-form-item label="车牌号：" prop="plateNum">
									<el-input size="small" :maxlength="200" v-model="infoData.plateNum" readonly></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="车型：" prop="carModel">
									<el-input placeholder="请选择车型" :maxlength="200" size="small" icon="search" v-model="infoData.carModel" :on-icon-click="chooseSearchModel" readonly></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="厂牌代码：" prop="label">
									<el-input placeholder="请输入 厂牌代码" size="small" v-model="infoData.label"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="发动机号：" prop="engineNum">
									<el-input size="small" :maxlength="200" v-model="infoData.engineNum"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="车架号：" prop="vin">
									<el-input size="small" :maxlength="200" v-model="infoData.vin" readonly></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="发动机类型：" prop="carType">
									<el-input size="small" :maxlength="200" v-model="infoData.carType"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="排量/功率：" prop="power">
									<el-input size="small" :maxlength="200" v-model="infoData.power"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="载客/载重量：" prop="passengerWeight">
									<el-input size="small" :maxlength="200" v-model="infoData.passengerWeight"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="使用性质：" prop="useProperty">
									<el-input size="small" :maxlength="200" v-model="infoData.useProperty"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="行驶证车主：" prop="driverLicense">
									<el-input size="small" :maxlength="200" v-model="infoData.driverLicense"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="初次登记日期：" prop="firstRecordDate">
									<el-input size="small" v-model="infoData.firstRecordDate" placeholder="例如'2017-01-01'"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="6">
								<el-form-item label="实际价值：" prop="realValue">
									<el-input size="small" :maxlength="200" v-model="infoData.realValue"></el-input>
								</el-form-item>
							</el-col>
						</el-form>
					</el-card>
				</el-col>
			</el-row>
			<el-row>
				<div class="table-d" v-if="templateShow == '1'">
					<table border="1" cellspacing="1" cellpadding="10" style="color:rgb(103,106,108);font-size: 10px;width: 100%;border-collapse: collapse;">
						<tr>
							<td colspan="7"><b style="text-align: center;">保险报价单  </b></td>
						</tr>
						<tr>
							<td style="width:25%;text-align: center;background-color: #55C0F1;color: #333333;"><b>主要投保险种  </b></td>
							<td style="width:15%;text-align: center;background-color: #55C0F1;color: #333333;"><b>保额/限额 </b></td>
							<td style="width:10%;text-align: center;background-color: #55C0F1;color: #333333;"><b>保险费  </b></td>
							<td style="width:5%;text-align: center;background-color: #55C0F1;color: #333333;"><b>是否 </b></td>
							<td style="width:10%;text-align: center;background-color: #55C0F1;color: #333333;"><b>不计免赔保费  </b></td>
							<td style="width:25%;text-align: center;background-color: #55C0F1;color: #333333;"><b>保险险种</b></td>
							<td style="width:10%;text-align: center;background-color: #55C0F1;color: #333333;"><b>保险费</b></td>
						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[2].starts" @change="startChange('2')">车辆损失险</el-checkbox>
							</td>
							<td></td>
							<td rowspan="1"><input v-model="intem[2].price" class='table_input' v-on:blur="sumPrice"></td>
							<td rowspan="1" style="text-align: center;">
								<el-checkbox v-model="intem[3].starts" @change="startChange('3')"></el-checkbox>
							</td>
							<td rowspan="1"><input v-model="intem[3].price" class='table_input' v-on:blur="sumPrice"></td>
							<td>
								<el-checkbox v-model="intem[1].starts" @change="startChange('1')">交强险</el-checkbox>
							</td>
							<td><input v-model="intem[1].price" class='table_input' v-on:blur="sumPrice">
							</td>
						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[4].starts" @change="startChange('4')">第三者责任险</el-checkbox>
							</td>
							<td rowspan="1">
								<el-select v-model="intem[4].limit" @change="quotaChange('4')" size="small">
									<el-option label="5万" value="50000"></el-option>
									<el-option label="10万" value="100000"></el-option>
									<el-option label="15万" value="150000"></el-option>
									<el-option label="20万" value="200000"></el-option>
									<el-option label="30万" value="300000"></el-option>
									<el-option label="50万" value="500000"></el-option>
									<el-option label="100万" value="1000000"></el-option>
									<el-option label="150万" value="1500000"></el-option>
									<el-option label="200万" value="2000000"></el-option>
								</el-select>
							</td>
							<td rowspan="1"><input v-model="intem[4].price" class='table_input' v-on:blur="sumPrice"></td>
							<td rowspan="1" style="text-align: center;">
								<el-checkbox v-model="intem[5].starts" @change="startChange('5')"></el-checkbox>
							</td>
							<td rowspan="1"><input v-model="intem[5].price" class='table_input' v-on:blur="sumPrice"></td>
							<td>
								<el-checkbox v-model="intem[0].starts" style="color: red;" @change="startChange('0')">车船使用税</el-checkbox>
							</td>
							<td><input v-model="intem[0].price" class='table_input' v-on:blur="sumPrice">
							</td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[6].starts" @change="startChange('6')">盗抢险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[6].price" class='table_input' v-on:blur="sumPrice"></td>
							</td>

							<td style="text-align: center;">
								<el-checkbox v-model="intem[7].starts" @change="startChange('7')"></el-checkbox>
							</td>
							<td><input v-model="intem[7].price" class='table_input' v-on:blur="sumPrice"></td>
							<td></td>
							<td></td>
						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[8].starts" @change="startChange('8')">车上人员责任险-司机</el-checkbox>
							</td>
							<td><input v-model="intem[8].limit" v-on:blur="quotaChange('8')" style="width: 90%;border-style:none;outline:medium;">万
							</td>
							<td><input v-model="intem[8].price" class='table_input' v-on:blur="sumPrice"></td>
							<td style="text-align: center;">
								<el-checkbox v-model="intem[10].starts" @change="startChange('10')"></el-checkbox>
							</td>
							<td><input v-model="intem[10].price" class='table_input' v-on:blur="sumPrice"></td>
							<td>
								<el-checkbox v-model="intem[22].starts" @change="startChange('22')">润华划痕险</el-checkbox>
							</td>
							<td><input v-model="intem[22].price" class='table_input' v-on:blur="sumPrice"></td>

						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[9].starts" @change="startChange('9')">车上人员责任险-乘客</el-checkbox>
							</td>
							<td><input v-model="intem[9].limit" v-on:blur="quotaChange('9')" style="width: 90%;border-style:none;outline:medium;">万</td>
							<td><input v-model="intem[9].price" class='table_input' v-on:blur="sumPrice"></td>
							<td style="text-align: center;">
								<el-checkbox v-model="intem[11].starts" @change="startChange('11')"></el-checkbox>
							</td>
							<td><input v-model="intem[11].price" class='table_input' v-on:blur="sumPrice"></td>
							<td>
								<el-checkbox v-model="intem[23].starts" @change="startChange('23')">续保手册</el-checkbox>
							</td>
							<td><input v-model="intem[23].price" class='table_input' v-on:blur="sumPrice"></td>

						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[12].starts" @change="startChange('12')">车身划痕险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[12].price" class='table_input' v-on:blur="sumPrice"></td>
							<td style="text-align: center;">
								<el-checkbox v-model="intem[13].starts" @change="startChange('13')"></el-checkbox>
							</td>
							<td><input v-model="intem[13].price" class='table_input' v-on:blur="sumPrice"></td>
							<td>
								<el-checkbox v-model="intem[21].starts" @change="startChange('21')">车上货物责任险</el-checkbox>
							</td>
							<td><input v-model="intem[21].price" class='table_input' v-on:blur="sumPrice"></td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[18].starts" @change="startChange('18')">玻璃单独玻璃险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[18].price" class='table_input' v-on:blur="sumPrice"></td>
							<td></td>
							<td></td>
							<td>
								<el-checkbox v-model="intem[24].starts" @change="startChange('24')">驾意险</el-checkbox>
							</td>
							<td><input v-model="intem[24].price" class='table_input' v-on:blur="sumPrice"></td>
						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[20].starts" @change="startChange('20')">机动车损失保险无法找到第三方特约险</el-checkbox>
							</td>
							<td></td>
							<td rowspan="1"><input v-model="intem[20].price" class='table_input' v-on:blur="sumPrice"></td>
							<td></td>
							<td></td>
							<td>
								<el-checkbox v-model="intem[19].starts" @change="startChange('19')">润华玻璃险</el-checkbox>
							</td>
							<td><input v-model="intem[19].price" class='table_input' v-on:blur="sumPrice"></td>
						</tr>
						<tr>

							<td>
								<el-checkbox v-model="intem[14].starts" @change="startChange('14')">自燃损失险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[14].price" class='table_input' v-on:blur="sumPrice"></td>
							<td style="text-align: center;">
								<el-checkbox v-model="intem[15].starts" @change="startChange('15')"></el-checkbox>
							</td>
							<td><input v-model="intem[15].price" class='table_input' v-on:blur="sumPrice"></td>
							<td></td>
							<td></td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[16].starts" @change="startChange('16')">发动机涉水险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[16].price" class='table_input' v-on:blur="sumPrice"></td>
							<td style="text-align: center;">
								<el-checkbox v-model="intem[17].starts" @change="startChange('17')"></el-checkbox>
							</td>
							<td style="border-bottom-right-radius: 2px;"><input v-model="intem[17].price" class='table_input' v-on:blur="sumPrice"></td>
							<td></td>
							<td></td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[26].starts" @change="startChange('26')">新增设备险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[26].price" class='table_input' v-on:blur="sumPrice"></td>
							<td style="text-align: center;">
								<el-checkbox v-model="intem[27].starts" @change="startChange('27')"></el-checkbox>
							</td>
							<td><input v-model="intem[27].price" class='table_input' v-on:blur="sumPrice"></td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
				<div class="table-d" v-if="templateShow == '0'||templateShow == '2'">
					<table border="1" cellspacing="1" cellpadding="10" style="color:rgb(103,106,108);font-size: 10px;width: 100%;border-collapse: collapse;">
						<tr>
							<td colspan="7"><b style="text-align: center;">保险报价单  </b></td>
						</tr>
						<tr>
							<td style="width:25%;text-align: center;background-color: #55C0F1;color: #333333;"><b>主要投保险种  </b></td>
							<td style="width:15%;text-align: center;background-color: #55C0F1;color: #333333;"><b>保额/限额 </b></td>
							<td style="width:10%;text-align: center;background-color: #55C0F1;color: #333333;"><b>保险费  </b></td>
							<td style="width:25%;text-align: center;background-color: #55C0F1;color: #333333;"><b>保险险种</b></td>
							<td style="width:10%;text-align: center;background-color: #55C0F1;color: #333333;"><b>保险费</b></td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[1].starts" @change="startChangeTwo('1')">交强险</el-checkbox>
							</td>
							<td>
							</td>
							<td><input v-model="intem[1].price" class='table_input' v-on:blur="sumPrice">
							</td>
							<td>
								<el-checkbox v-model="intem[14].starts" @change="startChangeTwo('14')">自燃损失险</el-checkbox>
							</td>

							<td><input v-model="intem[14].price" class='table_input' v-on:blur="sumPrice"></td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[0].starts" style="color: red;" @change="startChangeTwo('0')">车船使用税</el-checkbox>
							</td>
							<td>
							</td>
							<td><input v-model="intem[0].price" class='table_input' v-on:blur="sumPrice">
							</td>
							<td>
								<el-checkbox v-model="intem[21].starts" @change="startChangeTwo('21')">车上货物责任险</el-checkbox>
							</td>
							<td><input v-model="intem[21].price" class='table_input' v-on:blur="sumPrice"></td>

						</tr>
						<td rowspan="1">
							<el-checkbox v-model="intem[2].starts" @change="startChangeTwo('2')">车辆损失险</el-checkbox>
						</td>
						<td></td>
						<td rowspan="1"><input v-model="intem[2].price" class='table_input' v-on:blur="sumPrice"></td>
						<td>
							<el-checkbox v-model="intem[16].starts" @change="startChangeTwo('16')">发动机涉水险</el-checkbox>
						</td>

						<td><input v-model="intem[16].price" class='table_input' v-on:blur="sumPrice"></td>

						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[4].starts" @change="startChangeTwo('4')">第三者责任险</el-checkbox>
							</td>
							<td rowspan="1">
								<el-select v-model="intem[4].limit" size="small">
									<el-option label="5万" value="50000"></el-option>
									<el-option label="10万" value="100000"></el-option>
									<el-option label="15万" value="150000"></el-option>
									<el-option label="20万" value="200000"></el-option>
									<el-option label="30万" value="300000"></el-option>
									<el-option label="50万" value="500000"></el-option>
									<el-option label="100万" value="1000000"></el-option>
									<el-option label="150万" value="1500000"></el-option>
									<el-option label="200万" value="2000000"></el-option>
								</el-select>
							</td>
							<td rowspan="1"><input v-model="intem[4].price" class='table_input' v-on:blur="sumPrice"></td>

							<td>
								<el-checkbox v-model="intem[24].starts" @change="startChangeTwo('24')">驾意险</el-checkbox>
							</td>
							<td><input v-model="intem[24].price" class='table_input' v-on:blur="sumPrice"></td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[6].starts" @change="startChangeTwo('6')">盗抢险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[6].price" class='table_input' v-on:blur="sumPrice"></td>
							</td>

							<td>
								<el-checkbox v-model="intem[19].starts" @change="startChangeTwo('19')">润华玻璃险</el-checkbox>
							</td>
							<td><input v-model="intem[19].price" class='table_input' v-on:blur="sumPrice"></td>
						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[8].starts" @change="startChangeTwo('8')">车上人员责任险-司机</el-checkbox>
							</td>
							<td><input v-model="intem[8].limit" style="width: 90%;border-style:none;outline:medium;">万
							</td>
							<td><input v-model="intem[8].price" class='table_input' v-on:blur="sumPrice"></td>

							<td>
								<el-checkbox v-model="intem[22].starts" @change="startChangeTwo('22')">润华划痕险</el-checkbox>
							</td>
							<td><input v-model="intem[22].price" class='table_input' v-on:blur="sumPrice"></td>

						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[9].starts" @change="startChangeTwo('9')">车上人员责任险-乘客</el-checkbox>
							</td>
							<td><input v-model="intem[9].limit" style="width: 90%;border-style:none;outline:medium;">万</td>
							<td><input v-model="intem[9].price" class='table_input' v-on:blur="sumPrice"></td>

							<td>
								<el-checkbox v-model="intem[23].starts" @change="startChangeTwo('23')">续保手册</el-checkbox>
							</td>
							<td><input v-model="intem[23].price" class='table_input' v-on:blur="sumPrice"></td>

						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[18].starts" @change="startChangeTwo('18')">玻璃单独玻璃险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[18].price" class='table_input' v-on:blur="sumPrice"></td>

							<td></td>
							<td></td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[12].starts" @change="startChangeTwo('12')">车身划痕险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[12].price" class='table_input' v-on:blur="sumPrice"></td>

							<td></td>
							<td></td>
						</tr>
						<tr>
							<td rowspan="1">
								<el-checkbox v-model="intem[20].starts" @change="startChangeTwo('20')">机动车损失保险无法找到第三方特约险</el-checkbox>
							</td>
							<td></td>
							<td rowspan="1"><input v-model="intem[20].price" class='table_input' v-on:blur="sumPrice"></td>

							<td></td>
							<td></td>
						</tr>
						<tr v-if="templateShow != '2'">
							<td>
								<el-checkbox v-model="intem[25].starts" @change="startChangeTwo('25')">不计免赔</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[25].price" class='table_input' v-on:blur="sumPrice"></td>

							<td></td>
							<td></td>
						</tr>
						<tr>
							<td>
								<el-checkbox v-model="intem[26].starts" @change="startChangeTwo('26')">新增设备险</el-checkbox>
							</td>
							<td></td>
							<td><input v-model="intem[26].price" class='table_input' v-on:blur="sumPrice"></td>

							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</el-row>
			<br>
			<el-row :gutter="24">
				<el-col :span="2">
					<strong style="font-size: 15px;padding-top: 0px;">交强险价格:</strong>
				</el-col>
				<el-col :span="2">
					<strong style="font-size: 15px;padding-top: 0px;">{{jqxbj}}￥</strong>
				</el-col>
				<el-col :span="2">
					<strong style="font-size: 15px;padding-top: 0px;">车船税价格:</strong>
				</el-col>
				<el-col :span="2">
					<strong style="font-size: 15px;padding-top: 0px;">{{ccsjg}}￥</strong>
				</el-col>
				<el-col :span="2">
					<strong style="font-size: 15px;padding-top: 0px;">商业险价格:</strong>
				</el-col>
				<el-col :span="2">
					<strong style="font-size: 15px;padding-top: 0px;">{{syxbj}}￥</strong>
				</el-col>
				<el-col :span="2">
					<strong style="font-size: 15px;padding-top: 0px;">合计:</strong>
				</el-col>
				<el-col :span="2">
					<strong style="font-size: 15px;padding-top: 0px;">{{sum}}￥</strong>
				</el-col>
				<br><br>
			</el-row>
			<el-row :gutter="24">
				<el-col :span="4" style="padding-left: 0px;text-align: right">
					<el-button type="primary" v-on:click='comFormShowsClose'>关闭窗口</el-button>
				</el-col>
				<el-col :span="4" style="padding-left: 0px;text-align: right">
					<el-button type="primary" v-on:click='qqClick'>报价请求单</el-button>
				</el-col>
				<el-col :span="4" style="padding-left: 0px;text-align: right">
					<el-button type="primary" v-on:click='xyClick'>生成短信模板</el-button>
				</el-col>
				<el-col :span="4" style="padding-left: 0px;text-align: right">
					<el-button type="primary" v-on:click='comFormShowsSure'>保存</el-button>
				</el-col>
				<el-col :span="4" style="padding-left: 0px;text-align: right">
					<el-button type="primary" v-on:click='orderClick' v-loading.fullscreen.lock="fullscreenloading">保险出单</el-button>
				</el-col>
			</el-row>
		</el-dialog>
		<el-dialog title="保险出单" v-model="orderShow" size="small" :before-close="outPresentDelete">
			<el-row :gutter="24">
				<el-col :span="24">
					<el-form :model="orderFromData" label-width="150px" ref="bxOrderForms" :rules="bxOrderRule">
						<el-row :gutter="24">
							<el-col :span="12">
								<el-form-item label="出单日期：" prop="outOrderDate">
									<el-date-picker size="small" style="width: 100%;" v-model="orderFromData.outOrderDate" type="date" placeholder="开始时间" @change="outDateChange">
									</el-date-picker>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="交款人：" prop="payPeople">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.payPeople"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="支付方式：" prop="payType">
									<el-select size="small" style="width: 105%;" v-model="orderFromData.payType" placeholder="选择方式">
										<el-option label="现金" value="1">
										</el-option>
										<el-option label="刷卡" value="2">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="支付账号：" prop="payNum">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.payNum"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row :gutter="24">
							<el-col :span="12">
								<el-form-item label="商业险合同号：" v-if="syItemsShow" prop="commercialinsuranceNum">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.commercialinsuranceNum"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="商业险起始日期：" v-if="syItemsShow" prop="commercialinsuranceStartDate" required>
									<el-date-picker size="small" @change="dateChange" disabled style="width: 100%;" v-model="orderFromData.commercialinsuranceStartDate" format="yyyy-MM-dd" type="date" placeholder="开始时间">
									</el-date-picker>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="商业险结束日期：" v-if="syItemsShow" prop="commercialinsuranceStopDate" required>
									<el-date-picker size="small" style="width: 100%; " disabled v-model="orderFromData.commercialinsuranceStopDate" type="date" placeholder="结束时间">
									</el-date-picker>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="商业险协议费率：" v-if="!orderFromData.isCommissionSyTemp&&syItemsShow" required>
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.commissionSy" readonly>
										<template slot="append">%</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="店端加投费率：" v-if="syItemsShow">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.addCommission" type="number">
										<template slot="append">%</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="店端抵现金额：" v-if="syItemsShow">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.discount" type="number">
										<template slot="append">元</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item prop="isCommissionSyTemp" v-if="syItemsShow">
									<el-checkbox label="启用商业险临时费率" name="type" v-model="orderFromData.isCommissionSyTemp">
										<template slot="append">%</template>
									</el-checkbox>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="商业险临时费率：" v-if="orderFromData.isCommissionSyTemp&&syItemsShow" prop="commissionSyTemp" required>
									<el-input size="small" style="width:100%" v-model="orderFromData.commissionSyTemp" type="number">
										<template slot="append">%</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="佣金说明：" v-if="orderFromData.isCommissionSyTemp&&syItemsShow" prop="commissionSyExp">
									<el-input size="small" :maxlength="200" style="width:100%" v-model="orderFromData.commissionSyExp"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row :gutter="24">
							<el-col :span="12">
								<el-form-item label="交强险合同号：" v-if="jqItemsShow" prop="compulsoryNum">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.compulsoryNum"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="交强险起始日期：" v-if="jqItemsShow" prop="compulsoryStartDate" required>
									<el-date-picker size="small" @change="dateChanges" disabled style="width: 100%;" v-model="orderFromData.compulsoryStartDate" type="date" placeholder="开始时间">
									</el-date-picker>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="交强险结束日期：" v-if="jqItemsShow" prop="compulsoryStopDate" required>
									<el-date-picker size="small" style="width: 100%; " disabled v-model="orderFromData.compulsoryStopDate" type="date" placeholder="结束时间">
									</el-date-picker>
								</el-form-item>
							</el-col>

							<el-col :span="12">
								<el-form-item label="交强险协议费率：" v-if="!orderFromData.isCommissionJqTemp&&jqItemsShow">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.commissionJq" readonly>
										<template slot="append">%</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item prop="isCommissionJqTemp" v-if="jqItemsShow">
									<el-checkbox label="启用交强险临时费率 " name="type" v-model="orderFromData.isCommissionJqTemp">
										<template slot="append">%</template>
									</el-checkbox>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="交强险临时费率：" v-if="orderFromData.isCommissionJqTemp&& jqItemsShow" prop="commissionJqTemp">
									<el-input size="small" style="width:100%" v-model="orderFromData.commissionJqTemp" type="number">
										<template slot="append">%</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="交强险佣金说明：" v-if="orderFromData.isCommissionJqTemp&&jqItemsShow" prop="commissionJqExp">
									<el-input size="small" :maxlength="200" style="width:100%" v-model="orderFromData.commissionJqExp"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row :gutter="24">
							<el-col :span="12">
								<el-form-item label="返现金额：" prop="backPrice">
									<el-input size="small" :maxlength="200" style="width: 100%;" type="number" v-model="orderFromData.backPrice">
										<template slot="append">元</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12" style="text-align: right;">
								<el-form-item label="" prop="">
									<template v-if="jqItemsShow&&!syItemsShow" style="text-align: left;">
										<el-switch v-model="continuous" size="small" on-color="#13ce66" off-color="#ff4949" on-text="是" off-text="否" on-value="true" off-value="false">联保</el-switch>
										<span style="font-size: 14px;font-weight: 600;">&nbsp;联保&nbsp;&nbsp;</span>
									</template>
									<el-button size="small" type="primary" @click="persentShow=true">查看赠品信息</el-button>

								</el-form-item>

							</el-col>
							<el-col :span="12">
								<el-form-item label="销售专员：" prop="insuranceCommissionerId">
									<el-select size="small" v-model="orderFromData.insuranceCommissionerId" filterable placeholder="选择人员">
										<el-option v-for="item in salePeopleCombo" :label="item.uname" :value="item.id">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="基盘类别：" prop="baseType" required>
									<el-select size="small" style="width: 105%;" v-model="orderFromData.baseType" placeholder="选择项目">
										<el-option v-for="item in insTypeConvertData" :label="item.label" :value="item.id">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="新车属性：" prop="carProperty" required>
									<el-select size="small" style="width: 105%;" v-model="orderFromData.carProperty" placeholder="选择新车属性">
										<el-option label="新车金融" value="xcjr">
										</el-option>
										<el-option label="新车全款" value="xcqk">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="车辆销售属性：" prop="salesProperty" required>
									<el-select size="small" style="width: 105%;" v-model="orderFromData.salesProperty" placeholder="选择销售属性">
										<el-option label="本地销" value="bdx">
										</el-option>
										<el-option label="外地销" value="wdx">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="24">
								<el-form-item label="优惠信息：" prop="discountInfo">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.discountInfo" type="textarea"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24">
								<el-form-item label="备注：" prop="remark">
									<el-input size="small" :maxlength="200" style="width: 100%;" v-model="orderFromData.remark" type="textarea"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
					</el-form>
				</el-col>
			</el-row>
			<el-row :gutter="24">
				<el-col :span="24" style="padding-left: 0px;text-align: right">
					<el-button v-on:click='outPresentDelete'>取消</el-button>
					<el-button type="primary" v-on:click='saveOrder' v-loading.fullscreen.lock="fullscreenloading" v-if="containSure">确认</el-button>

				</el-col>
			</el-row>
		</el-dialog>
		<el-dialog title="价格确认" v-model="sureShow" size="tiny">
			<el-row :gutter="24">
				<el-col :span="24">
					<el-form :model="xyFromData" label-width="100px">
						<el-col :span="24">
							<el-form-item label="商业险价格:" prop="">
								<span>{{syxbj}} 元</span>
							</el-form-item>
						</el-col>
						<el-col :span="24">
							<el-form-item label="交强险价格:" prop="">
								<span>{{jqxbj}} 元</span>
							</el-form-item>
						</el-col>
						<el-col :span="24">
							<el-form-item label="车船税价格:" prop="">
								<span>{{ccsjg}} 元</span>
							</el-form-item>
						</el-col>

						<el-col :span="24">
							<el-form-item label="合计:" prop="">
								<span>{{sum}} 元</span>
							</el-form-item>
						</el-col>
					</el-form>
				</el-col>
			</el-row>
			<el-row :gutter="24">
				<el-col :span="24" style="padding-left: 0px;text-align: right;margin-bottom: 20px;">
					<el-button v-on:click='sureShow=false'>取消</el-button>
					<el-button type="primary" v-on:click='saveEdit' v-loading.fullscreen.lock="fullscreenloading">确认</el-button>

				</el-col>
			</el-row>
		</el-dialog>
		<el-dialog title="查看客户信息" v-model="customShow" size="small">
			<customer :qType="qType" :qCompanyId="qCompanyId" :qValue="qValue" v-if="customShow" style="width: 100%;"></customer>
		</el-dialog>
		<el-dialog title="赠品选择窗" v-model="presentShow" size="mini">
			<el-form :model="presentData" label-width="130px">
				<el-col :span="24">
					<el-form-item label="市场活动：" prop="">
						<el-select size="small" placeholder="市场活动" v-model="presentData.activityId">
							<el-option :label="item.name" :value="item.id" v-for="item in activities">
							</el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="数量：" prop="">
						<el-input-number :min="1" v-model="presentData.nums"></el-input-number>
					</el-form-item>
				</el-col>
				<el-col :span="24" style="padding-left: 0px;text-align: right;margin-bottom: 20px;">
					<el-button v-on:click='presentShow=false'>取消</el-button>
					<el-button type="primary" v-on:click='savePresent'>确认</el-button>

				</el-col>
			</el-form>
		</el-dialog>
		<el-dialog title="赠品信息" size="small" v-model="persentShow">
			<el-row :span="24">
				<el-col :span="12">
					<strong>赠品信息</strong>
				</el-col>
				<el-col :span="12" style="text-align: right;">
					<el-button type="info" size="small" @click="addPresent" v-if="containSure">增加</el-button>
				</el-col>
			</el-row>
			<el-row :span="24">
				<el-table :data="pretableData.dataList" height="200" border>
					<el-table-column prop="gift" label="赠品名称">
					</el-table-column>
					<el-table-column label="数量">
						<template scope="scope">
							<span>1</span>
						</template>
					</el-table-column>
					<el-table-column label="操作" v-if="containSure" width="100px">
						<template scope="scope">
							<el-button size="small" type="danger" @click="presentDelete(scope.$index, scope.row)">删除</el-button>
						</template>
					</el-table-column>
				</el-table>
			</el-row>
		</el-dialog>
		<el-dialog title="选择车型" v-model="searchCarShow" size="small">
			<el-row :gutter="24">
				<el-col :span="11" style="margin-left:5px;">
				</el-col>
				<el-col :span="24" style="margin-left:5px;">
					<div style="height: 3em;"></div>
				</el-col>
				<el-col :span="24" style="margin-left:5px; height: 250px;overflow: scroll;">
					<el-tree :data="SearchTreeData" :filter-node-method="filterNode" :highlight-current=true :props="defaultProps" accordion @node-click="searchNodeClick" :auto-expand-parent=false node-key="id"></el-tree>
				</el-col>
			</el-row>

			<div slot="footer" class="dialog-footer">
				<el-button @click="searchCarShow = false">取 消</el-button>
				<el-button type="primary" @click="serchSaveCar">提 交</el-button>
			</div>
		</el-dialog>
	</div>
</template>

<script>
	export default {
		data: function() {
			return {
				salePeopleCombo: [], //店内人员
				searchCarShow: false,
				//搜索的车型数据
				SearchTreeData: [],
				//树型数据配置
				defaultProps: {
					children: "child",
					label: "label"
				},
				searhcarType: "",
				searchdatavale: "",
				searchdatalabel: "",
				activities: [],
				containSure: true,
				presentShow: false,
				persentShow: false,
				//市场活动查询数据
				presentData: {
					activityId: "",
					nums: "",
					carId: ""
				},
				btnGroup: {},
				qType: "",
				qValue: "",
				qCompanyId: "",
				customShow: false,
				sureShow: false,
				//保单sa本人
				checked: true,
				//获取基盘下拉
				insTypeConvertData: [],
				//保险出单的确认按钮
				containSure: true,
				infoData: {
					//点击设置进来查出的数据
					source: "", //被保险人类型0个人1单位
					label: "",
					insured: "",
					compulsoryTotal: "",
					insuredIdNumber: "",
					carType: "",
					useProperty: "",
					commercialinsuranceTotal: "",
					driverLicense: "",
					vin: "",
					id: "",
					ower: "",
					email: "",
					passengerWeight: "",
					contactName: "",
					engineNum: "",
					updateUser: "",
					updateTime: "",
					firstRecordDate: "",
					plateNum: "",
					insuranceStopDate: "",
					carAge: "",
					realValue: "",
					companyId: "",
					createTime: "",
					createUser: "",
					postCode: "",
					insuredAddress: "",
					contactPhone: "",
					insuranceStartDate: "",
					//					carModel: "",
					carLevel: "",
					carValue: ""
				},
				//报价单显示
				comFormShows: false,
				//获取维系记录用的公司ID
				companyId: "",
				//维系历史强制刷新
				changeHis: 1,
				//客户最近报价单
				insPriceData: [],
				//最近的工单
				work: {
					workOrder: [],
					workItem: [],
					quotation: []
				},
				//客户信息：
				comFormData: {
					plateNum: "", //车牌号
					carModel: "", //车型
					vin: "",
					carAge: "", //车龄
					insured: "", //被保险人
					contactPhone: "", //联系电话
					insuranceCompany: "", //投保公司
					insuranceEndDate: "" //投保到期日
				},
				//客户信息初始化
				comFormDataEmpty: {
					plateNum: "", //车牌号
					carModel: "", //车型
					vin: "",
					carAge: "", //车龄
					insured: "", //被保险人
					contactPhone: "", //联系电话
					insuranceCompany: "", //投保公司
					insuranceEndDate: "" //投保到期日
				},
				//处理界面显示
				handleAppealShow: false,
				//查询条件
				queryData: {
					area: "", //区域
					companyId: "", //4S店
					appealName: "", //求助人
					plateNum: "", //车牌号
					vin: "", //VIN
					helpDate: "", //求助时间
					doneDate: "", //完成时间
					status: "" //处理状态
				},
				//区域信息
				areaCombo: [],
				//4S店信息
				companyCombo: [],
				//表格数据
				tableData: {
					total: 0,
					dataList: []
				},
				//表格中选中的数据
				tableSelectData: [],
				CurentPage: 1, //当前页
				page: this.page,
				//保险项目
				intem: [{
						name: "交强险-车船使用税",
						type: 0,
						limit: "",
						price: "",
						id: 0,
						starts: false
					},
					{
						name: "交强险-保险费",
						type: 1,
						limit: "",
						price: "",
						id: 1,
						starts: false
					},
					{
						name: "车辆损失险",
						type: 1,
						limit: "",
						price: "",
						id: 2,
						starts: false
					},
					{
						name: "车辆损失险不计免赔",
						type: 1,
						limit: "",
						price: "",
						id: 3,
						starts: false
					},
					{
						name: "第三者责任险",
						type: 1,
						limit: "",
						price: "",
						id: 4,
						starts: false
					},
					{
						name: "第三者责任险不计免赔",
						type: 1,
						limit: "",
						price: "",
						id: 5,
						starts: false
					},
					{
						name: "盗抢险",
						type: 1,
						limit: "",
						price: "",
						id: 6,
						starts: false
					},
					{
						name: "盗抢险不计免赔",
						type: 1,
						limit: "",
						price: "",
						id: 7,
						starts: false
					},
					{
						name: "车上人员责任险-司机",
						type: 1,
						limit: "",
						price: "",
						id: 8,
						starts: false
					},
					{
						name: "车上人员责任险-乘客",
						type: 1,
						limit: "",
						price: "",
						id: 9,
						starts: false
					},
					{
						name: "车上人员责任险-司机-不计免赔",
						type: 1,
						limit: "",
						price: "",
						id: 10,
						starts: false
					},
					{
						name: "车上人员责任险-乘客-不计免赔",
						type: 1,
						limit: "",
						price: "",
						id: 11,
						starts: false
					},
					{
						name: "车身划痕险",
						type: 1,
						limit: "",
						price: "",
						id: 12,
						starts: false
					},
					{
						name: "车身划痕险不计免赔",
						type: 1,
						limit: "",
						price: "",
						id: 13,
						starts: false
					},
					{
						name: "自燃损失险",
						type: 1,
						limit: "",
						price: "",
						id: 14,
						starts: false
					},
					{
						name: "自燃损失险不计免赔",
						type: 1,
						limit: "",
						price: "",
						id: 15,
						starts: false
					},
					{
						name: "发动机涉水险",
						type: 1,
						limit: "",
						price: "",
						id: 16,
						starts: false
					},
					{
						name: "发动机涉水险不计免赔",
						type: 0,
						limit: "",
						price: "",
						id: 17,
						starts: false
					},
					{
						name: "玻璃单独玻璃险",
						type: 0,
						limit: "",
						price: "",
						id: 18,
						starts: false
					},
					{
						name: "润华玻璃险",
						type: 0,
						limit: "",
						price: "",
						id: 19,
						starts: false
					},
					{
						name: "机动车损失保险无法找到第三方特约险",
						type: 0,
						limit: "",
						price: "",
						id: 20,
						starts: false
					},
					{
						name: "车上货物责任险",
						type: 0,
						limit: "",
						price: "",
						id: 21,
						starts: false
					},
					{
						name: "润华划痕险",
						type: 0,
						limit: "",
						price: "",
						id: 22,
						starts: false
					},
					{
						name: "续保手册",
						type: 0,
						limit: "",
						price: "",
						id: 23,
						starts: false
					},
					{
						name: "驾意险",
						type: 0,
						limit: "",
						price: "",
						id: 24,
						starts: false
					},
					{
						name: "不计免赔",
						type: 0,
						limit: "",
						price: "",
						id: 25,
						starts: false
					},
					{
						name: "新增设备险",
						type: 0,
						limit: "",
						price: "",
						id: 26,
						starts: false
					},
					{
						name: "新增设备险不计免赔",
						type: 0,
						limit: "",
						price: "",
						id: 27,
						starts: false
					}
				],
				//出单页面的实体
				orderFromData: {
					discount: "", //店端抵现金额
					addCommission: "", //店端加投费率
					commissionSyId: "",
					commissionJqId: "",
					companyId: "",
					carId: "",
					insuranceCompanyId: "",
					insured: "",
					contactPhone: "",
					outOrderDate: "",
					payType: "2", //支付方式
					payPeople: "",
					payNum: "", //支付账号
					commercialinsuranceNum: "",
					commercialinsuranceStartDate: "", //商业
					commercialinsuranceStopDate: "",
					commercialinsurancePrice: "",
					commercialinsuranceBackPrice: "",
					commissionSy: "", //商业险佣金
					commissionSyTemp: "", //商业险临时佣金
					isCommissionSyTemp: false, //是否启用商业险
					commissionSyExp: "", //商业险佣金说明
					compulsoryNum: "", //交强险合同号
					compulsoryStartDate: "", //交强
					compulsoryStopDate: "",
					compulsoryPrice: "",
					backPrice: "0",
					commissionJq: "", //交强险佣金
					commissionJqTemp: "", //交强险临时佣金
					isCommissionJqTemp: false, //是否启用交强险
					commissionJqExp: "", //交强险佣金说明
					backType: "",
					backDate: "",
					quotationId: "",
					//					commissionRate: "",
					commission: "",
					insuranceCommissionerName: "",
					baseType: "",
					discountInfo: "",
					remark: "",
					carProperty: "", //新车属性
					salesProperty: "", //销售属性
					continuous: "" //是否联保
				},
				//出单页面的实体清空
				emptyOrderFromData: {
					discount: "", //店端抵现金额
					addCommission: "", //店端加投费率
					commissionSyId: "",
					commissionJqId: "",
					companyId: "",
					carId: "",
					insuranceCompanyId: "",
					insured: "",
					contactPhone: "",
					outOrderDate: "",
					payType: "2",
					payPeople: "",
					payNum: "",
					commercialinsuranceNum: "",
					commercialinsuranceStartDate: "",
					commercialinsuranceStopDate: "",
					commercialinsurancePrice: "",
					commercialinsuranceBackPrice: "",
					compulsoryNum: "",
					compulsoryStartDate: "",
					compulsoryStopDate: "",
					compulsoryPrice: "",
					backPrice: "0",
					backType: "",
					backDate: "",
					quotationId: "",
					//					commissionRate: "",
					commission: "",
					insuranceCommissionerName: "",
					baseType: "",
					discountInfo: "",
					remark: "",
					carProperty: "", //新车属性
					salesProperty: "", //销售属性
					continuous: "" //是否联保
				},
				jqxbj: "",
				syxbj: "",
				ccsjg: "",
				heji: "",
				sum: "",
				pretableData: {
					dataList: []
				},
				//保险项目模板
				templateShow: "",
				qqFromData: {
					qqText: ""
				},
				xyFromData: {
					xyText: ""
				},
				//报价请求单
				qqShow: false,
				//报价响应单
				xyShow: false,
				//校验规则
				Rule: {
					//TODO
					insuredIdNumber: [{
						required: true,
						message: "请输入被保险人证件号",
						trigger: "blur"
					}],
					insured: [{
						required: true,
						message: "请输入被保险人",
						trigger: "blur"
					}],
					//					insuredAddress: [{
					//						required: true,
					//						message: '请输入被保险人地址',
					//						trigger: 'blur'
					//					}],
					postCode: [{
						required: true,
						message: "请输入邮编",
						trigger: "blur"
					}],
					contactName: [{
						required: true,
						message: "请输入联系人",
						trigger: "blur"
					}],
					contactPhone: [{
						required: true,
						message: "请输入联系电话",
						trigger: "blur"
					}],
					//					email: [{
					//						required: true,
					//						message: '请输入email',
					//						trigger: 'blur'
					//					}],
					carModel: [{
						required: true,
						message: "请选择车型",
						trigger: "blur"
					}],
					//					engineNum: [{
					//						required: true,
					//						message: '请输入发动机号',
					//						trigger: 'blur'
					//					}],
					driverLicense: [{
						required: true,
						message: "请输入行驶证车主",
						trigger: "blur"
					}],
					firstRecordDate: [{
						required: true,
						message: "请选择初次登记日期",
						trigger: "blur"
					}]
				},
				fullscreenloading: false,
				orderShow: false,
				//保险出单验证
				bxOrderRule: {
					//					outOrderDate: [{
					//						type: 'date',
					//						required: true,
					//						message: '请选择出单日期',
					//						trigger: 'blur'
					//					}],
					payPeople: [{
						required: true,
						message: "请填写交款人",
						trigger: "blur"
					}],
					payType: [{
						required: true,
						message: "请填写支付方式",
						trigger: "blur"
					}],
					commercialinsuranceNum: [{
						required: true,
						message: "请填写商业险合同号",
						trigger: "blur"
					}],
					commercialinsuranceStartDate: [{
						type: "date",
						required: true,
						message: "请选择商业险开始日期",
						trigger: "blur"
					}],
					commercialinsuranceStopDate: [{
						type: "date",
						required: true,
						message: "请选择商业险结束日期",
						trigger: "blur"
					}],
					commissionSyTemp: [{
						//						type: "number",
						required: true,
						message: "请填写商业险临时佣金",
						trigger: "blur"
					}],
					compulsoryNum: [{
						required: true,
						message: "请填写交强险合同号",
						trigger: "blur"
					}],
					compulsoryStartDate: [{
						type: "date",
						required: true,
						message: "请选择交强险开始日期",
						trigger: "blur"
					}],
					compulsoryStopDate: [{
						type: "date",
						required: true,
						message: "请选择交强险结束日期",
						trigger: "blur"
					}],
					commissionJq: [{
						required: true,
						message: "请填写临时佣金",
						trigger: "blur"
					}],
					commissionSy: [{
						required: true,
						message: "请填写临时佣金",
						trigger: "blur"
					}],
					commissionJqTemp: [{
						//						type: "number",
						required: true,
						message: "请填写交强险临时佣金",
						trigger: "blur"
					}],
					backPrice: [{
						required: true,
						message: "请填写返现金额",
						trigger: "blur"
					}],
					baseType: [{
						required: true,
						message: "请选择基盘类别",
						trigger: "blur"
					}],
					carProperty: [{
						required: true,
						message: "请选择新车属性",
						trigger: "blur"
					}],
					salesProperty: [{
						required: true,
						message: "请选择销售属性",
						trigger: "blur"
					}]
				},
				syItemsShow: false,
				jqItemsShow: false,
				showStart: false,
				jqorsy: "", //0是交强1是商业
				presentQId: "",
				presentCarId: "",
				insuranceCompanyId: "",
				qid: "",
				outStatus: false,
				addOrEdit: true,
				//合同号尾数
				numberone: ""
			};
		},
		methods: {
			//打开搜索的车型选择
			chooseSearchModel: function() {
				this.$data.searchCarShow = true;
			},
			//资源过滤
			filterNode: function(value, data, node) {
				if(!value) return true;
				return data.label.indexOf(value) !== -1;
			},
			//查询搜索的参数树
			querySearchTree: function() {
				//获取资源树
				debugger;
				this.$http.get(this.API_ROOT + "/base/car/tree", {}).then(
					response => {
						this.$data.SearchTreeData = response.data;
					},
					response => {}
				);
			},
			//点击搜索的资源树节点
			searchNodeClick(data) {
				//TODO
				debugger;
				this.$data.infoData.carValue = "";
				this.$data.infoData.carLevel = "";
				//
				this.$data.searhcarType = data.type;
				this.$data.searchdatalabel = data.label;
				this.$data.searchdatavale = data.value;
				this.$data.infoData.carLevel = data.type;
				this.$data.infoData.carValue = data.value;
			},
			//搜索确认车型
			serchSaveCar: function() {
				debugger;
				if(this.$data.searhcarType == 0) {
					this.$message.error("请不要选择品牌！");
				} else {
					this.$data.infoData.carModel = this.$data.searchdatalabel;
					this.$data.customerData.carLevel = this.$data.searhcarType;
					this.$data.customerData.carModel = this.$data.searchdatalabel;
					this.$data.searchCarShow = false;
				}
			},
			//打开车型车系选择
			handleIconClick: function() {
				this.$data.searchCarShow = true;
			},
			//保存赠品信息
			savePresent: function() {
				debugger;
				this.$http
					.get(this.API_ROOT + "/crm/coupon/createInsuranceActivityCoupon", {
						params: {
							companyId: this.$data.tableSelectData[0].companyId,
							activityId: this.$data.presentData.activityId,
							nums: this.$data.presentData.nums,
							carId: this.$data.comFormData.id,
							qId: this.$data.presentQId
						}
					})
					.then(
						response => {
							debugger;
							//					this.$data.pretableData.dataList=response.data.data;
							this.$data.presentShow = false;
							this.queryPresent(this.$data.presentCarId, this.$data.presentQId);
						},
						response => {
							debugger;
						}
					);
			},
			//增加赠品按钮
			addPresent: function() {
				this.$data.presentShow = true;
				this.queryActivity();
			},
			//获取市场活动
			queryActivity: function() {
				this.$http
					.get(this.API_ROOT + "/crm/activity/activityIng", {
						params: {
							companyId: this.$data.tableSelectData[0].companyId
						}
					})
					.then(
						response => {
							debugger;
							this.$data.activities = response.data.data;
							//this.$data.infoData = Object.assign(this.$data.infoData, response.data.data);
						},
						response => {
							debugger;
						}
					);
			},
			//点击客户详情
			butClick: function() {
				debugger;
				this.$data.customShow = true;
				this.$data.qType = 1;
				this.$data.qCompanyId = this.$data.tableSelectData[0].companyId;
				this.$data.qValue = this.$data.tableSelectData[0].vin;
			},
			changePrice: function(index) {
				debugger;
				//显示窗口
				if(this.$data.insPriceData[index].status == 2) {
					this.$message.error("该报价单已出单不能进行编辑");
				} else {
					this.$data.checkData = this.$data.insPriceData[index];
					this.$data.comFormShows = true;
					//请求车辆及客户信息系
					this.$http
						.get(this.API_ROOT + "/insurance/car/carInfo", {
							params: {
								id: this.$data.checkData.id
							}
						})
						.then(
							response => {
								debugger;
								this.$data.infoData = Object.assign(
									this.$data.infoData,
									response.data.data
								);
								//被保险人类型若为"",默认为"0"：个人
								if(
									this.$data.infoData.source == "" ||
									this.$data.infoData.source == null ||
									this.$data.infoData.source == "null"
								) {
									this.$data.infoData.source = "0";
								}
								this.$data.infoData.insuranceStartDate = this.$data.checkData.insuranceStartDate;
								this.$data.infoData.insuranceStopDate = this.$data.checkData.insuranceStopDate;
								this.$data.orderFromData.payPeople = response.data.data.insured;
							},
							response => {
								debugger;
							}
						);
					//请求保险项目
					this.intemInfo();
					this.getTemplateShow(this.$data.checkData.insuranceCompanyId);
				}
			},
			//保存报价单（点保存的时候要询问是否出单）
			saveEdit: function() {
				debugger;
				this.$data.fullscreenloading = true;
				var syPrice = Number(this.$data.syxbj).toFixed(2);
				this.sureShow = false;
				if(syPrice == 0) {
					this.yujingSave();
				} else {
					//报价检测
					//					this.$http.get(this.API_ROOT + '/insurance/Quotation/checkWarning', {
					//						params: {
					//							carId: this.$data.checkData.id,
					//							syPrice: syPrice,
					//						}
					//					}).then(resp => {
					//						debugger;
					//						if(resp.data.success) {
					this.yujingSave();
					//						} else {
					//							this.$data.yujingShow = true;
					//							this.$data.yujingMsg = resp.data.msg;
					//						}
					//					}, resp => {});
				}
			},
			yujingSave: function() {
				//保存保险项目
				var items = [];
				var y = 0;
				for(var i = 0; i < this.$data.intem.length; i++) {
					debugger;
					if(this.$data.intem[i].starts == true) {
						items[y] = this.$data.intem[i];
						y++;
					}
				}
				debugger;
				this.$http
					.post(this.API_ROOT + "/insurance/QuotationItem/save", items, {
						params: {
							QuotationId: this.$data.checkData.qid
						}
					})
					.then(
						resp => {
							if(resp.data.success) {
								this.$data.infoData.insuranceStartDate = this.moment(
									this.$data.infoData.insuranceStartDate
								).format("YYYY-MM-DD");
								this.$data.infoData.insuranceStopDate = this.moment(
									this.$data.infoData.insuranceStopDate
								).format("YYYY-MM-DD");
								this.$http
									.post(
										this.API_ROOT + "/insurance/Quotation/update",
										this.$data.infoData, {
											//更新报价单
											params: {
												id: this.$data.checkData.qid
											}
										}
									)
									.then(
										resp => {
											debugger;
											this.$data.fullscreenloading = false;
											if(resp.data.success) {
												//								this.$data.yujingShow = false;
												this.$data.comFormShows = false;
												if(this.$data.outStatus == true) {
													this.$data.fullscreenloading = true;
													this.outOrdersave();
												}
											} else {
												this.$message.error(resp.data.msg);
												//								this.$data.yujingShow = false;
												this.$data.comFormShows = false;
											}
										},
										resp => {}
									);
							} else {
								//debugger;
								this.$data.fullscreenloading = false;
								this.$message.error(resp.data.msg);
							}
						},
						resp => {}
					);
			},
			//保险出单预警
			outOrdersave: function() {
				//TODO
				debugger;
				this.$data.syItemsShow = false;
				this.$data.jqItemsShow = false;
				this.$data.comFormShows = false;
				if(this.$data.addOrEdit == false) {
					var qId = this.$data.checkData.qid;
					var carId = this.$data.checkData.id;
					this.$data.presentQId = qId;
					this.$data.presentCarId = carId;
					this.$data.insuranceCompanyId = this.$data.checkData.insuranceCompanyId;
					//查询保险单
					this.$http
						.get(this.API_ROOT + "/insurance/Order/info", {
							params: {
								qId: qId,
								carId: carId
							}
						})
						.then(
							response => {
								debugger;
								if(
									response.data.data.syItems == 0 &&
									response.data.data.jqItems == 0
								) {
									this.$message.error("还未录入保险项目，请先进行设置录入");
									return false;
								} else {
									this.$data.orderFromData = Object.assign(
										this.$data.orderFromData,
										this.$data.emptyOrderFromData
									);
									if(response.data.data.syItems > 0) {
										this.$data.syItemsShow = true;
										this.$data.orderFromData.commercialinsuranceStartDate = new Date(
											this.$data.checkData.insuranceStartDate
										);
										this.$data.orderFromData.commercialinsuranceStopDate = new Date(
											this.$data.checkData.insuranceStopDate
										);
									}
									if(response.data.data.jqItems > 0) {
										this.$data.jqItemsShow = true;
										this.$data.orderFromData.compulsoryStartDate = new Date(
											this.$data.checkData.insuranceStartDate
										);
										this.$data.orderFromData.compulsoryStopDate = new Date(
											this.$data.checkData.insuranceStopDate
										);
									}
									if(response.data.data.id) {
										//this.$data.orderInfoData=response.data.data;
										this.$data.orderFromData = response.data.data;
										this.$data.orderFromData.compulsoryNum =
											response.data.data.compulsoryNum;
										this.$data.orderFromData.commercialinsuranceNum =
											response.data.data.commercialinsuranceNum;
										//出单按钮等待框消失
										this.$data.fullscreenloading = false;
										this.$data.orderShow = true; //出单弹出框
										if(this.$data.orderFromData.continuous) {
											this.$data.continuous = this.$data.orderFromData.continuous;
										} else {
											this.$data.continuous = "false";
										}
										this.$data.orderFromData.commissionSy = ""; //出单界面弹出清空商业险佣金
										this.$data.orderFromData.commissionJq = ""; //出单界面弹出清空交强险佣金
										this.$data.containSure = false;
									} else {
										if(this.$data.checkData.insureType == "sb") {
											for(
												var i = 0; i < this.$data.insTypeConvertData.length; i++
											) {
												if(this.$data.insTypeConvertData[i].label == "新保") {
													this.$data.orderFromData.baseType = this.$data.insTypeConvertData[
														i
													].id;
													break;
												}
											}
										}
										this.$data.orderFromData.outOrderDate = new Date(); //出单日期默认今天
										this.$data.containSure = true;
										//出单按钮等待框消失
										this.$data.fullscreenloading = false;
										this.$data.orderShow = true; //出单弹出框
										this.$data.continuous = "false";
										this.$data.orderFromData.commissionSy = ""; //出单界面弹出清空商业险佣金
										this.$data.orderFromData.commissionJq = ""; //出单界面弹出清空交强险佣金
										var id =
											this.$data.checkData.insuranceCompanyId ||
											this.$data.checkData.insuranceCompanyId;
										this.queryContractNo(id); //查询商业险合同号
									}
									this.$data.orderFromData.payPeople = this.$data.checkData.insured;
									this.queryCom(qId);
									this.queryPresent(carId, qId); //查询添加的赠品信息
								}
								this.$data.fullscreenLoading = false;
							},
							response => {
								debugger;
							}
						);
				} else {
					var qId = this.$data.checkData.qid;
					var carId = this.$data.checkData.id;
					this.$data.presentQId = qId;
					this.$data.presentCarId = carId;
					this.$data.insuranceCompanyId = this.$data.checkData.insuranceCompanyId;
					//查询保险单
					this.$http
						.get(this.API_ROOT + "/insurance/Order/info", {
							params: {
								qId: qId,
								carId: carId
							}
						})
						.then(
							response => {
								debugger;
								if(
									response.data.data.syItems == 0 &&
									response.data.data.jqItems == 0
								) {
									this.$message.error("还未录入保险项目，请先进行设置录入");
									return false;
								} else {
									this.$data.orderFromData = Object.assign(
										this.$data.orderFromData,
										this.$data.emptyOrderFromData
									);
									if(response.data.data.syItems > 0) {
										this.$data.syItemsShow = true;
										this.$data.orderFromData.commercialinsuranceStartDate = new Date(
											this.$data.checkData.insuranceStartDate
										);
										this.$data.orderFromData.commercialinsuranceStopDate = new Date(
											this.$data.checkData.insuranceStopDate
										);
									}
									if(response.data.data.jqItems > 0) {
										this.$data.jqItemsShow = true;
										this.$data.orderFromData.compulsoryStartDate = new Date(
											this.$data.checkData.insuranceStartDate
										);
										this.$data.orderFromData.compulsoryStopDate = new Date(
											this.$data.checkData.insuranceStopDate
										);
									}
									if(response.data.data.id) {
										//this.$data.orderInfoData=response.data.data;
										this.$data.orderFromData = response.data.data;
										this.$data.orderFromData.compulsoryNum =
											response.data.data.compulsoryNum;
										this.$data.orderFromData.commercialinsuranceNum =
											response.data.data.commercialinsuranceNum;
										//出单按钮等待框消失
										this.$data.fullscreenloading = false;
										this.$data.orderShow = true; //出单弹出框
										if(this.$data.orderFromData.continuous) {
											this.$data.continuous = this.$data.orderFromData.continuous;
										} else {
											this.$data.continuous = "false";
										}
										this.$data.orderFromData.commissionSy = ""; //出单界面弹出清空商业险佣金
										this.$data.orderFromData.commissionJq = ""; //出单界面弹出清空交强险佣金
										this.$data.containSure = false;
									} else {
										if(this.$data.checkData.insureType == "sb") {
											for(
												var i = 0; i < this.$data.insTypeConvertData.length; i++
											) {
												if(this.$data.insTypeConvertData[i].label == "新保") {
													this.$data.orderFromData.baseType = this.$data.insTypeConvertData[
														i
													].id;
													break;
												}
											}
										}
										this.$data.orderFromData.outOrderDate = new Date(); //出单日期默认今天
										this.$data.containSure = true;
										//出单按钮等待框消失
										this.$data.fullscreenloading = false;
										this.$data.orderShow = true; //出单弹出框
										this.$data.continuous = "false";
										this.$data.orderFromData.commissionSy = ""; //出单界面弹出清空商业险佣金
										this.$data.orderFromData.commissionJq = ""; //出单界面弹出清空交强险佣金
										var id =
											this.$data.checkData.insuranceCompanyId ||
											this.$data.checkData.insuranceCompanyId;
										this.queryContractNo(id); //查询商业险合同号
									}
									this.$data.orderFromData.payPeople = this.$data.checkData.insured;
									this.queryCom(qId);
									this.queryPresent(carId, qId); //查询添加的赠品信息
								}
								this.$data.fullscreenLoading = false;
							},
							response => {
								debugger;
							}
						);
				}
			},
			//查询交强险和商业险合同号
			queryContractNo: function(insuranceCompanyId) {
				this.$http
					.get(this.API_ROOT + "/insurance/info", {
						params: {
							id: insuranceCompanyId
						}
					})
					.then(
						response => {
							debugger;
							if(response.data.success) {
								this.$data.orderFromData.compulsoryNum =
									response.data.data.contractJqNO;
								this.$data.orderFromData.commercialinsuranceNum =
									response.data.data.contractSyNO;
								//合同号位数验证
								this.$data.numberone = response.data.data.templet;
							} else {
								this.$message.error(response.data.msg);
							}
						},
						response => {
							debugger;
						}
					);
			},
			//查询赠品信息
			queryPresent: function(id, qid) {
				this.$http
					.get(this.API_ROOT + "/crm/coupon/getInsuranceActivityCoupon", {
						params: {
							carId: id,
							qId: qid
						}
					})
					.then(
						response => {
							this.$data.pretableData.dataList = response.data.data;
							//					this.$data.presentShow=false;
						},
						response => {
							debugger;
						}
					);
			},
			//请求已经选中的报价单项目
			intemInfo: function() {
				//debugger;
				this.$http
					.get(this.API_ROOT + "/insurance/QuotationItem/hasQuotationList", {
						params: {
							id: this.$data.checkData.qid
						}
					})
					.then(
						response => {
							debugger;
							for(var j = 0; j < this.$data.intem.length; j++) {
								this.$data.intem[j].starts = false;
								this.$data.intem[j].limit = "";
								this.$data.intem[j].price = "";
							}

							var respData = response.data;
							for(var i = 0; i < respData.length; i++) {
								for(var j = 0; j < this.$data.intem.length; j++) {
									if(this.$data.intem[j].id == respData[i].itemId) {
										this.$data.intem[j].starts = true;
										this.$data.intem[j].limit = respData[i].itemLimit;
										this.$data.intem[j].price = respData[i].itemPrice;
										break;
									}
								}
							}
							this.sumPrice();
						},
						response => {
							debugger;
						}
					);
			},
			//保存保险出单
			saveOrder: function() {
				debugger;
				if(
					this.$data.orderFromData.compulsoryNum ==
					this.$data.orderFromData.commercialinsuranceNum
				) {
					this.$message.error("商业险合同号与交强险合同号不能相同！");
					return false;
				}
				if(this.$data.orderFromData.outOrderDate == "") {
					this.$message.error("请选择出单日期！");
					return false;
				}
				this.$refs.bxOrderForms.validate(
					function(valid, $event) {
						// 验证通过
						if(valid) {
							//						this.$confirm("出单日期为：" + this.$data.orderFromData.outOrderDate + "   请确认信息填写正确，然后点确认按钮出单.", '提示', { //出单询问
							//							confirmButtonText: '确定',
							//							cancelButtonText: '取消',
							//							type: 'warning'
							//						}).then(() => {
							debugger;
							//							this.$data.fullscreenloading = true;
							this.$data.orderFromData.carId = this.$data.presentCarId;
							this.$data.orderFromData.quotationId = this.$data.presentQId;
							this.$data.orderFromData.outOrderDate = this.momentFu(
								this.$data.orderFromData.outOrderDate
							);
							this.$data.orderFromData.commercialinsuranceStartDate = this.momentFu(
								this.$data.orderFromData.commercialinsuranceStartDate
							);
							this.$data.orderFromData.commercialinsuranceStopDate = this.momentFu(
								this.$data.orderFromData.commercialinsuranceStopDate
							);
							this.$data.orderFromData.compulsoryStartDate = this.momentFu(
								this.$data.orderFromData.compulsoryStartDate
							);
							this.$data.orderFromData.compulsoryStopDate = this.momentFu(
								this.$data.orderFromData.compulsoryStopDate
							);
							this.$data.orderFromData.insuranceCompanyId = this.$data.insuranceCompanyId;
							this.$data.orderFromData.continuous = this.$data.continuous; //是否联保
							debugger;
							this.$http
								.post(
									this.API_ROOT + "/insurance/Order/save/seek/help",
									this.$data.orderFromData, {
										//TODO
										params: {
											helpId: this.$data.tableSelectData[0].id
										}
									}
								)
								.then(
									resp => {
										this.$data.fullscreenloading = false;
										if(resp.data.success) {
											debugger;
											this.$message(resp.data.msg);
											this.$data.orderShow = false;
											//隐藏
											this.$data.itemShow = false;
											this.$data.handleAppealShow = false;
											this.queryAppeal();
											//this.insPriceQuery(this.$data.tableSelectData[0].insuranceCompanyId,this.$data.tableSelectData[0].vin);
										} else {
											this.$data.orderFromData.commercialinsuranceStartDate = new Date(
												this.$data.orderFromData.commercialinsuranceStartDate
											);
											this.$data.orderFromData.commercialinsuranceStopDate = new Date(
												this.$data.orderFromData.commercialinsuranceStopDate
											);
											this.$data.orderFromData.compulsoryStartDate = new Date(
												this.$data.orderFromData.compulsoryStartDate
											);
											this.$data.orderFromData.compulsoryStopDate = new Date(
												this.$data.orderFromData.compulsoryStopDate
											);
											this.$message.error(resp.data.msg);
										}
									},
									resp => {}
								);
							//						}).catch(() => {
							//							this.$message({
							//								type: 'info',
							//								message: '取消出单'
							//							});
							//						});
						}
					}.bind(this)
				);
			},
			//时间判断为空的封装
			momentFu: function(dt) {
				if(dt == "" || dt == null || dt == undefined) {
					return "";
				} else {
					return this.moment(dt).format("YYYY-MM-DD");
				}
			},
			//查询佣金
			queryCom: function(qId) {
				this.$data.orderFromData.outOrderDate = this.moment(
					this.$data.orderFromData.outOrderDate
				).format("YYYY-MM-DD"); //出单日期默认今天
				this.$http
					.get(this.API_ROOT + "/insurance/commission/getInsuranceCommission", {
						params: {
							quotationId: qId,
							time: this.$data.orderFromData.outOrderDate
						}
					})
					.then(
						response => {
							debugger;
							if(response.data.success) {
								this.$data.outOrder = response.data.data;
								this.$data.orderFromData.commissionSyId =
									response.data.data.sy.id;
								this.$data.orderFromData.commissionJqId =
									response.data.data.jq.id;
								this.$data.orderFromData.commissionSy =
									response.data.data.sy.commission;
								this.$data.orderFromData.commissionJq =
									response.data.data.jq.commission;
							} else {
								this.$message.error(response.data.msg);
							}
						},
						response => {
							debugger;
						}
					);
			},
			//时间默认计算
			dateChange: function() {
				debugger;
				var star = this.$data.orderFromData.commercialinsuranceStartDate;
				if(this.$data.orderFromData.commercialinsuranceStartDate == "") {
					this.$data.orderFromData.commercialinsuranceStopDate = "";
				} else {
					this.$data.orderFromData.commercialinsuranceStopDate = new Date(
						this.moment(star)
						.add(12, "month")
						.add(-1, "day")
					);
				}
			},
			//时间默认计算
			dateChanges: function() {
				debugger;
				var star = this.$data.orderFromData.compulsoryStartDate;
				if(this.$data.orderFromData.compulsoryStartDate == "") {
					this.$data.orderFromData.compulsoryStopDate = "";
				} else {
					this.$data.orderFromData.compulsoryStopDate = new Date(
						this.moment(star)
						.add(12, "month")
						.add(-1, "day")
					);
				}
			},
			//出单日期变化的时候，调用请求佣金，根据出单日期佣金变化
			outDateChange: function() {
				this.$data.orderFromData.outOrderDate = this.moment(
					this.$data.orderFromData.outOrderDate
				).format("YYYY-MM-DD");
				var qId = this.$data.presentQId;
				var now = this.moment().format("YYYY-MM-DD");
				if(this.$data.orderFromData.outOrderDate > now) {
					this.$message.error("出单日期不可以在未来");
					this.$data.orderFromData.outOrderDate = now;
				}
				this.queryCom(qId);
			},
			//取消出单时 删除赠品信息
			outPresentDelete: function() {
				debugger;

				if(this.$data.containSure == false) {
					this.$data.orderShow = false;
				} else if(this.$data.pretableData.dataList.length == 0) {
					this.$data.orderShow = false;
				} else {
					//shanchu 赠品信息
					for(var i = 0; i < this.$data.pretableData.dataList.length; i++) {
						this.$http
							.get(this.API_ROOT + "/crm/coupon/delInsuranceActivityCoupon", {
								params: {
									couponId: this.$data.pretableData.dataList[i].id
								}
							})
							.then(
								response => {},
								response => {
									debugger;
								}
							);
					}
					this.$data.orderShow = false;
				}
			},
			comFormShowsClose: function() {
				this.$confirm("此操作将不会保存输入的数据, 是否继续?", "提示", {
						confirmButtonText: "确定",
						cancelButtonText: "取消",
						type: "warning"
					})
					.then(() => {
						this.queryAppeal();
						this.$data.comFormShows = false;
					})
					.catch(() => {
						this.$message({
							type: "info",
							message: "已取消"
						});
					});
			},
			//查询求助申请
			queryAppeal: function() {
				if(this.$data.queryData.helpDate) {
					this.$data.queryData.helpDate = this.moment(
						this.$data.queryData.helpDate
					).format("YYYY-MM-DD");
				}
				if(this.$data.queryData.doneDate) {
					this.$data.queryData.doneDate = this.moment(
						this.$data.queryData.doneDate
					).format("YYYY-MM-DD");
				}
				if(this.$data.queryData.companyId == "") {
					this.$message.error("请选择公司！");
				} else {
					this.$http({
						method: "POST",
						url: this.API_ROOT + "/insurance/task/seek/help/page", //url
						body: this.$data.queryData,
						params: {
							//发送的参数
							limit: this.page.pageSize,
							start: this.$data.CurentPage
						}
					}).then(
						function(resp) {
							resp.data.total = parseInt(resp.data.total);
							this.$data.tableData = resp.data;
						},
						function(error) {
							// error
						}
					);
				}
			},
			//处理求助申请
			handleAppeal: function() {
				if(this.$data.tableSelectData.length != 1) {
					this.$message.error("请选择一条数据！");
				} else {
					debugger;
					var companyId = this.$data.tableSelectData[0].companyId; //保险公司ID
					this.$data.companyId = this.$data.tableSelectData[0].companyId; //用于维系记录查询
					var vin = this.$data.tableSelectData[0].vin; //VIN
					var carId = this.$data.tableSelectData[0].carId;
					//处理界面显示
					this.$data.handleAppealShow = true;
					//查询客户信息
					this.customerDataQuery(companyId, vin);
					//查询报价单
					this.insPriceQuery(companyId, vin);
					//查询维修项目
					this.workItemQuery(carId, vin, companyId);
				}
			},
			//查询客户信息
			customerDataQuery: function(companyId, vin) {
				this.$http({
					method: "POST",
					url: this.API_ROOT + "/insurance/car/info",
					params: {
						key: 1,
						value: vin,
						companyId: companyId
					}
				}).then(
					function(resp) {
						if(resp.data.success) {
							debugger;
							this.$data.comFormData = Object.assign(
								this.$data.comFormData,
								resp.data.data
							);
						} else {}
					},
					function(error) {}
				);
			},
			//查询报价单
			insPriceQuery: function(companyId, vin) {
				var data = {};
				data.companyId = companyId;
				data.vin = vin;
				this.$http({
					method: "POST",
					url: this.API_ROOT + "/insurance/Quotation/page",
					body: data,
					params: {}
				}).then(
					function(resp) {
						if(resp.data.success) {
							debugger;
							this.$data.insPriceData = resp.data.dataList;
						} else {}
					},
					function(error) {}
				);
			},
			//查询维修项目
			workItemQuery: function(carId, vin, companyId) {
				this.$http({
					method: "GET",
					url: this.API_ROOT + "/crm/workorder/work",
					params: {
						companyId: companyId,
						carId: carId,
						vin: vin
					}
				}).then(
					function(resp) {
						//success
						debugger;
						this.$data.work = resp.data;
					},
					function(error) {
						//error
					}
				);
			},
			/***************维系记录获取联系人↑****************/
			countTime: function(val) {
				if(val == "" || val == null) return "";
				return this.moment(Number(val)).format("YYYY-MM-DD");
			},
			tableRowClassName: function() {},
			//打开搜索的车型选择
			chooseSearchModel: function() {
				this.$data.searchCarShow = true;
			},
			//求助状态解析
			statusCov: function(row, column) {
				if(row.status == "0") {
					return "未处理";
				}
				if(row.status == "1") {
					return "已处理";
				}
			},
			//保险出单
			orderClick: function() {
				this.$data.outStatus = true;
				this.comFormShowsSure();
			},
			//确认价格之后再保存。
			comFormShowsSure: function() {
				debugger;
				if(
					this.$data.infoData.source == "0" &&
					this.isCardNo(this.$data.infoData.insuredIdNumber) == false
				) {
					this.$message.error("请填写正确的身份证号！");
				} else {
					this.$refs.comForm.validate(
						function(valid, $event) {
							// 验证通过
							if(valid) {
								debugger;
								var sum = 0;
								for(var i = 0; i < this.$data.intem.length; i++) {
									//勾选保险项目为填写保费 时
									if(
										this.$data.intem[i].starts == true &&
										this.$data.intem[i].price == ""
									) {
										this.$message.error(this.$data.intem[i].name + "未填写保费!");
										return false;
									}
									//三者保额验证
									if(
										i == 4 &&
										this.$data.intem[i].starts == true &&
										this.$data.intem[i].limit == ""
									) {
										this.$message.error(this.$data.intem[i].name + "未填写保额!");
										return false;
									}
									//车上司机保额验证
									if(
										i == 8 &&
										this.$data.intem[i].starts == true &&
										this.$data.intem[i].limit == ""
									) {
										this.$message.error(this.$data.intem[i].name + "未填写保额!");
										return false;
									}
									//车上乘客保额验证
									if(
										i == 9 &&
										this.$data.intem[i].starts == true &&
										this.$data.intem[i].limit == ""
									) {
										this.$message.error(this.$data.intem[i].name + "未填写保额!");
										return false;
									}
									if(this.$data.intem[i].starts == false) {
										sum = sum + 0;
									} else {
										sum = sum + 1;
									}
								}
								if(sum == 0) {
									this.$message.error("请至少选择一条保险项目,并且填写保费");
									return false;
								} else {
									this.sureShow = true;
									this.saveCusInfo(); //保存车主以及车辆信息
								}
							} else {
								this.$message.error("请完善客户信息！");
								return false;
							}
						}.bind(this)
					);
				}
			},
			//身份验证
			isCardNo: function(card) {
				debugger;
				// 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
				var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x|Y|y|)$)/;
				if(reg.test(card) === false) {
					return false;
				} else {
					return true;
				}
			},
			//保存报价单维护客户以及车辆信息
			saveCusInfo: function() {
				this.$http
					.post(this.API_ROOT + "/insurance/car/save", this.$data.infoData)
					.then(
						resp => {
							debugger;
							if(resp.data.success) {
								this.$message(resp.data.msg);
							} else {
								this.$message.error(resp.data.msg);
							}
						},
						resp => {}
					);
			},
			//列表，分页大小切换
			handleSizeChange: function() {},
			//列表,当前页切换
			handleCurrentChange: function(currentPage) {
				this.$data.CurentPage = currentPage;
				this.queryAppeal();
			},
			//勾选表格中的数据
			handleSelectionChange: function(val) {
				//存储表格中选中数据
				this.$data.tableSelectData = val;
			},
			//确认价格之后再保存。
			comFormShowsSure: function() {
				var sum = 0;
				for(var i = 0; i < this.$data.intem.length; i++) {
					//勾选保险项目为填写保费 时
					if(
						this.$data.intem[i].starts == true &&
						this.$data.intem[i].price == ""
					) {
						this.$message.error(this.$data.intem[i].name + "未填写保费!");
						return false;
					}
					//三者保额验证
					if(
						i == 4 &&
						this.$data.intem[i].starts == true &&
						this.$data.intem[i].limit == ""
					) {
						this.$message.error(this.$data.intem[i].name + "未填写保额!");
						return false;
					}
					//车上司机保额验证
					if(
						i == 8 &&
						this.$data.intem[i].starts == true &&
						this.$data.intem[i].limit == ""
					) {
						this.$message.error(this.$data.intem[i].name + "未填写保额!");
						return false;
					}
					//车上乘客保额验证
					if(
						i == 9 &&
						this.$data.intem[i].starts == true &&
						this.$data.intem[i].limit == ""
					) {
						this.$message.error(this.$data.intem[i].name + "未填写保额!");
						return false;
					}
					if(this.$data.intem[i].starts == false) {
						sum = sum + 0;
					} else {
						sum = sum + 1;
					}
				}
				if(sum == 0) {
					this.$message.error("请至少选择一条保险项目,并且填写保费");
					return false;
				} else {
					this.sureShow = true;
				}
			},
			//不计免赔何在一起
			startChangeTwo: function(num) {
				debugger;
				if(num == "0") {
					//车船税
					if(this.$data.intem[0].starts == true) {
						this.$data.intem[1].starts = true;
					}
					if(this.$data.intem[0].starts == false) {
						this.$data.intem[1].starts = false;
						this.$data.intem[0].price = "";
						this.$data.intem[1].price = "";
					}
				} else if(num == "1") {
					//交强险
					if(this.$data.intem[1].starts == true) {
						this.$data.intem[0].starts = true;
					}
					if(this.$data.intem[1].starts == false) {
						this.$data.intem[0].starts = false;
						this.$data.intem[0].price = "";
						this.$data.intem[1].price = "";
					}
				} else if(num == "8") {
					//车上人员-司机
					if(this.$data.intem[8].starts == true) {
						this.$data.intem[8].limit = "1";
					}
					if(this.$data.intem[8].starts == false) {
						this.$data.intem[8].limit = "";
						this.$data.intem[8].price = "";
					}
				} else if(num == "9") {
					//车上人员-乘客
					if(this.$data.intem[9].starts == true) {
						this.$data.intem[9].limit = "4";
					}
					if(this.$data.intem[9].starts == false) {
						this.$data.intem[9].limit = "";
						this.$data.intem[9].price = "";
					}
				} else if(this.$data.intem[num].starts == false) {
					this.$data.intem[num].limit = "";
					this.$data.intem[num].price = "";
				}
				this.sumPrice();
			},
			//点击请求单
			qqClick: function() {
				debugger;
				var itemsNames = "";
				for(var i = 0; i < this.$data.intem.length; i++) {
					if(this.$data.intem[i].starts == true) {
						if(i == 2) {
							itemsNames += this.$data.intem[i].name + "，";
						} else if(i == 4 || i == 5) {
							itemsNames +=
								this.$data.intem[i].name +
								"限额：" +
								this.$data.intem[i].limit +
								"元，";
						} else if(i == 8 || i == 9 || i == 10 || i == 11) {
							itemsNames +=
								this.$data.intem[i].name +
								"限额：" +
								this.$data.intem[i].limit +
								"万，";
						} else {
							itemsNames += this.$data.intem[i].name + "，";
						}
					}
				}
				this.$data.qqFromData.qqText =
					"车牌号为" +
					this.$data.infoData.plateNum +
					",车架号为" +
					this.$data.infoData.vin +
					"的车辆投保,项目包括" +
					itemsNames +
					"请给予报价。";
				this.$data.qqShow = true;
			},
			//点击响应单
			xyClick: function() {
				//debugger;
				//响应单的内容组合
				var itemsNames = "";
				//总价格
				//var sumPrice=0;
				for(var i = 0; i < this.$data.intem.length; i++) {
					if(this.$data.intem[i].starts == true) {
						if(i == 2) {
							itemsNames +=
								this.$data.intem[i].name + "(" + this.$data.intem[i].price + ");";
						} else if(i == 4 || i == 5) {
							itemsNames +=
								this.$data.intem[i].name +
								"限额：" +
								this.$data.intem[i].limit +
								"元，保险费：" +
								this.$data.intem[i].price +
								"元；";
						} else if(i == 8 || i == 9 || i == 10 || i == 11) {
							itemsNames +=
								this.$data.intem[i].name +
								"限额：" +
								this.$data.intem[i].limit +
								"万，保险费：" +
								this.$data.intem[i].price +
								"元；";
						} else {
							itemsNames +=
								this.$data.intem[i].name + "(" + this.$data.intem[i].price + "),";
						}
					}
				}
				//调用价格计算
				this.sumPrice();
				debugger;
				this.$data.xyFromData.xyText =
					"尊敬的客户【" +
					this.$data.infoData.contactName +
					"】" +
					"您好,您的保险方案为:" +
					itemsNames +
					";商业险价格：￥" +
					parseFloat(this.$data.syxbj) +
					"，交强险价格：￥" +
					parseFloat(this.$data.jqxbj) +
					"，车船税价格：￥" +
					parseFloat(this.$data.ccsjg) +
					"，合计：￥" +
					(parseFloat(this.$data.jqxbj) +
						parseFloat(this.$data.syxbj) +
						parseFloat(this.$data.ccsjg));
				this.$data.xyShow = true;
			},
			//三者，车上保额赋给不计免赔
			quotaChange: function(num) {
				if(num == "4") {
					this.$data.intem[5].limit = this.$data.intem[4].limit;
				} else if(num == "8") {
					this.$data.intem[10].limit = this.$data.intem[8].limit;
				} else if(num == "9") {
					this.$data.intem[11].limit = this.$data.intem[9].limit;
				}
			},
			//获取保险公司模板
			getTemplateShow: function(insuranceCompanyId) {
				debugger;
				this.$http({
					method: "POST",
					url: this.API_ROOT + "/insurance/info",
					params: {
						id: insuranceCompanyId
					}
				}).then(
					function(resp) {
						debugger;
						if(resp.data.success) {
							this.$data.templateShow = resp.data.data.templet;
						}
					},
					resp => {}
				);
			},
			//不计免赔分开选择险种自动选中不计免赔
			startChange: function(num) {
				debugger;
				if(num == "0") {
					//交强险
					if(this.$data.intem[0].starts == true) {
						this.$data.intem[1].starts = true;
					}
					if(this.$data.intem[0].starts == false) {
						this.$data.intem[1].starts = false;
						this.$data.intem[0].price = "";
						this.$data.intem[1].price = "";
					}
				} else if(num == "1") {
					if(this.$data.intem[1].starts == true) {
						this.$data.intem[0].starts = true;
					}
					if(this.$data.intem[1].starts == false) {
						this.$data.intem[0].starts = false;
						this.$data.intem[0].price = "";
						this.$data.intem[1].price = "";
					}
				} else if(num == "2") {
					//车辆损失险
					if(this.$data.intem[2].starts == true) {
						this.$data.intem[3].starts = true;
					}
					if(this.$data.intem[2].starts == false) {
						this.$data.intem[3].starts = false;
						this.$data.intem[2].price = "";
						this.$data.intem[3].price = "";
					}
				} else if(num == "4") {
					//第三者责任险
					if(this.$data.intem[4].starts == true) {
						this.$data.intem[5].starts = true;
					}
					if(this.$data.intem[4].starts == false) {
						this.$data.intem[5].starts = false;
						this.$data.intem[4].price = "";
						this.$data.intem[5].price = "";
						this.$data.intem[4].limit = "";
						this.$data.intem[5].limit = "";
					}
				} else if(num == "6") {
					//盗抢险
					if(this.$data.intem[6].starts == true) {
						this.$data.intem[7].starts = true;
					}
					if(this.$data.intem[6].starts == false) {
						this.$data.intem[7].starts = false;
						this.$data.intem[6].price = "";
						this.$data.intem[7].price = "";
					}
				} else if(num == "8") {
					//车上人员责任险-司机.司机
					if(this.$data.intem[8].starts == true) {
						this.$data.intem[10].starts = true;
						this.$data.intem[8].limit = "1";
						this.$data.intem[10].limit = "1";
					}
					if(this.$data.intem[8].starts == false) {
						this.$data.intem[10].starts = false;
						this.$data.intem[8].price = "";
						this.$data.intem[10].price = "";
						this.$data.intem[8].limit = "";
						this.$data.intem[10].limit = "";
					}
				} else if(num == "9") {
					//车上人员责任险-乘客
					if(this.$data.intem[9].starts == true) {
						this.$data.intem[11].starts = true;
						this.$data.intem[9].limit = "4";
						this.$data.intem[11].limit = "4";
					}
					if(this.$data.intem[9].starts == false) {
						this.$data.intem[11].starts = false;
						this.$data.intem[9].price = "";
						this.$data.intem[11].price = "";
						this.$data.intem[9].limit = "";
						this.$data.intem[11].limit = "";
					}
				} else if(num == "12") {
					//车身划痕险
					if(this.$data.intem[12].starts == true) {
						this.$data.intem[13].starts = true;
					}
					if(this.$data.intem[12].starts == false) {
						this.$data.intem[13].starts = false;
						this.$data.intem[12].price = "";
						this.$data.intem[13].price = "";
					}
				} else if(num == "14") {
					//自然损失险
					if(this.$data.intem[14].starts == true) {
						this.$data.intem[15].starts = true;
					}
					if(this.$data.intem[14].starts == false) {
						this.$data.intem[15].starts = false;
						this.$data.intem[14].price = "";
						this.$data.intem[15].price = "";
					}
				} else if(num == "16") {
					//发动机涉水险
					if(this.$data.intem[16].starts == true) {
						this.$data.intem[17].starts = true;
					}
					if(this.$data.intem[16].starts == false) {
						this.$data.intem[17].starts = false;
						this.$data.intem[16].price = "";
						this.$data.intem[17].price = "";
					}
				} else if(num == "26") {
					//发动机涉水险
					if(this.$data.intem[26].starts == true) {
						this.$data.intem[27].starts = true;
					}
					if(this.$data.intem[26].starts == false) {
						this.$data.intem[27].starts = false;
						this.$data.intem[26].price = "";
						this.$data.intem[27].price = "";
					}
				} else {
					if(this.$data.intem[num].starts == false) {
						this.$data.intem[num].price = "";
						this.$data.intem[num].limit = "";
					}
				}
				this.sumPrice();
			},
			//计算价格
			sumPrice: function() {
				//				compulsoryTotal 交强 险总价
				//              commercialinsuranceTotal 商业险总价
				//总价格
				debugger;
				var sumPrice = 0;
				for(var i = 0; i < this.$data.intem.length; i++) {
					if(
						this.$data.intem[i].starts == true &&
						this.$data.intem[i].price != ""
					) {
						this.$data.intem[i].price = Number(this.$data.intem[i].price);
						sumPrice = sumPrice + this.$data.intem[i].price;
					}
				}
				debugger;
				if(this.$data.intem[0].starts == true) {
					this.$data.ccsjg = Number(this.$data.intem[0].price).toFixed(2);
				} else {
					this.$data.ccsjg = 0;
				}
				if(this.$data.intem[1].starts == true) {
					this.$data.jqxbj = Number(this.$data.intem[1].price).toFixed(2);
				} else {
					this.$data.jqxbj = 0;
				}
				this.$data.syxbj = Number(
					sumPrice - this.$data.jqxbj - this.$data.ccsjg
				).toFixed(2);
				this.$data.sum = (Number(this.$data.jqxbj) +
					Number(this.$data.syxbj) +
					Number(this.$data.ccsjg)
				).toFixed(2);
				this.$data.orderFromData.commercialinsurancePrice = Number(
					this.$data.syxbj
				).toFixed(2); //商业
				this.$data.orderFromData.compulsoryPrice = Number(
					Number(this.$data.jqxbj) + Number(this.$data.ccsjg)
				).toFixed(2); //交强
				this.$data.orderFromData.commercialinsurancePrice = Number(
					this.$data.syxbj
				).toFixed(2); //商业
				this.$data.orderFromData.compulsoryPrice = Number(
					Number(this.$data.jqxbj) + Number(this.$data.ccsjg)
				).toFixed(2); //交强
			},
			insureTypeCov: function(row, column) {
				if(row.insureType == "sb") {
					return "新保";
				}
				if(row.insureType == "xb") {
					return "续保";
				}
			},
			//获取公司信息
			getCompanyInfo: function() {
				this.$data.queryData.companyId = ""; //清空选中的4S店
				this.$data.companyCombo = []; //清空4S店列表
				this.$http
					.get(this.API_ROOT + "/rbac/dept/all", {
						params: {
							area: this.$data.queryData.area
						}
					})
					.then(resp => {
						this.$data.companyCombo = resp.data.dataList;
						if(this.$data.companyCombo.length > 0) {
							this.$data.queryData.companyId = this.$data.companyCombo[0].id;
						}
					});
			},
			//获取区域
			getarea: function() {
				this.$http
					.get(this.API_ROOT + "/rbac/dept/area/all", {
						params: {}
					})
					.then(resp => {
						this.$data.areaCombo = resp.data.dataList;
					});
			}
		},
		created: function() {
			this.getarea(); //获取区域信息
			this.getCompanyInfo();
			this.querySearchTree();
			this.$data.changeHis = this.$data.changeHis + 1;
			//获取基盘类别
			this.$http
				.get(this.API_ROOT + "/base/dict/combo/insurance", {
					params: {
						group: "insuranceType"
					}
				})
				.then(
					response => {
						debugger;
						this.$data.insTypeConvertData = response.data;
					},
					response => {}
				);
			//获取销售人员
			this.$http.get(this.API_ROOT + '/rbac/user/allUser', {
				params: {}
			}).then((response) => {
				this.$data.salePeopleCombo = response.data.dataList;
			}, (response) => {});
			//配
			this.$http({
				method: "GET",
				url: this.API_ROOT + "/rbac/login/btn", //url 输出 按照车牌号的 车牌号
				params: {
					//发送的参数
					resPath: "bx/appealAcceptance" //
				}
			}).then(
				function(resp) {
					var btnData = resp.data.dataList;

					var temp = {};

					for(var i = 0; i < btnData.length; i++) {
						var btnName = btnData[i].btnName;

						temp[btnName] = true;
					}

					Object.assign(this.$data.btnGroup, temp);
				},
				function(error) {
					// error
				}
			);
		}
	};
</script>

<style>

</style>